<template>
    <el-row :gutter="20">
        <el-col :span="6" v-for="(item, index) in pvStationList" :key="index" @click="handlerDetail()">
            <div class="power-card">
                <div class="card-header">
                    <div class="location">激光产业园1栋</div>
                    <div class="capacity">400kWp</div>
                </div>

                <div class="card-body">
                    <div class="data-row">
                        <div class="data-item">
                            <div class="label">实时功率</div>
                            <div class="value power-value">73.59 kW</div>
                        </div>
                        <div class="data-item">
                            <div class="label">日发电量</div>
                            <div class="value energy-value">127.9 度</div>
                        </div>
                    </div>

                    <div class="data-row">
                        <div class="data-item">
                            <div class="label">日满发小时</div>
                            <div class="value hours-value">0.32 h</div>
                        </div>
                        <div class="data-item">
                            <div class="label">逆变器数量</div>
                            <div class="value inverter-value">3 台</div>
                        </div>
                    </div>
                </div>

                <div class="card-footer">
                    <div class="status normal">正常</div>
                </div>
            </div>
        </el-col>
    </el-row>
</template>

<script>
export default {
    name: 'PowerGenerationCard',
    props: {
        pvStationList: {
            type: Array,
            default: []
        }
    },
    watch: {
        pvStationList: {
            handler: function (val, oldVal) {
                this.stationList = val
            },
            deep: true
        },
    },
    data() {
        return {
            stationList: []
        }
    },
    methods: {
        handlerDetail() {

        }
    },
}
</script>

<style scoped>
.power-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.capacity {
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.card-body {
    padding: 16px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.data-item {
    flex: 1;
    text-align: center;
}

.data-item:first-child {
    border-right: 1px solid #f0f0f0;
}

.label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.value {
    font-size: 16px;
    font-weight: bold;
}

.power-value {
    color: #1890ff;
}

.energy-value {
    color: #52c41a;
}

.hours-value {
    color: #fa8c16;
}

.inverter-value {
    color: #722ed1;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.status.normal {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}
</style>